package org.turbobytes.unikey;

import java.io.Serializable;

/**
 * Core Interface that exposes methods to generate identifiers. This is a generic interface whose implementations
 * should statically resolve the type parameters while implementing the interface. This makes the implementation know
 * which data type it is going to work with
 *
 * @author Ganeshji Marwaha
 * @since Aug 5, 2010
 */
public interface IdGenerator<T> {

  /**
   * Generates Id for a given context. Implementations may use various strategies and optimization
   * routines to achieve this.
   * @param context for which to generate the id
   * @return generated id.
   */
  public T generate(String context);
  
}
